
/*
        商品类
 */
public class Goods {
    private String id;      //商品编号
    private String name;    //商品名称
    private double price;   //商品单价
    private String category;//商品类别
    //无参构造
    public Goods() {
    }

    //有参构造
    public Goods(String id, String name, double price, String category) {

        this.id = id;
        this.name = name;
        this.price = price;
        this.category = category;
    }

    //get，set方法

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    @Override
    public String toString() {
        return "商品编号："+id+"\n商品名称："+name+"\n商品单价："+price+"\n商品类别："+category;
    }
}
